<template>
	<view>
		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
			<view class="item" v-for="(item, index) in list" :key="item.id">
				<view style="display: inline-flex; justify-content: space-between;padding: 20rpx;">
					<text class="title">
						车牌号：{{item.carNo}}
					</text>
					<view class="btn-detail" style="color: #FFC000;background-color:#FFFFFF">
						{{item.processingStatus|processingStatus}}
					</view>
				</view>
		
				<u-line color="#efefef" margin="0 0 30rpx 0"></u-line>
		
				<view class="text-line">
					<text class="text-name">车架号:</text>
					<text class="text-value">{{item.vinNo|filterNull}}</text>
				</view>
		
				<view class="text-line">
					<text class="text-name">品牌/车系/车型:</text>
					<text class="text-value">{{item.carInfo|filterNull}}</text>
				</view>
		
				<view class="text-line">
					<text class="text-name">违章单据:</text>
					<text class="text-value">{{item.documentNo|filterNull}}</text>
				</view>
		
				<view class="text-line">
					<text class="text-name">违章时间:</text>
					<text class="text-value">{{item.illegalTime|filterNull}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">违章地点:</text>
					<text class="text-value">{{item.illegalLocation|filterNull}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">违章类型:</text>
					<text class="text-value">{{item.illegalType|illegalType}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">违章内容:</text>
					<text class="text-value">{{item.illegalDetail|filterNull}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">处理机构:</text>
					<text class="text-value">{{item.processingAgency|filterNull}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">违章扣分:</text>
					<text class="text-value">{{item.pointsDeduction|filterNull}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">罚款金额:</text>
					<text class="text-value">{{item.illegalFines|filterNull}}</text>
				</view>
		
			</view>
		</mescroll-body>
	</view>
</template>

<script>
	import {
		illegalList,
	} from '@/api/car-api.js';
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	export default {
		mixins: [MescrollMixin], // 使用mixin
		data() {
			return {
				carId : '',
				list : []
			}
		},
		onLoad(op) {
			this.carId = op.carId;
		},
		methods: {
		
			upCallback(page) {
				illegalList(this.carId).then(res => {
					//设置列表数据
					if (page.num == 1) this.list = []; //如果是第一页需手动制空列表
					this.list = this.list.concat(res.rows); //追加新数据
					this.mescroll.endBySize(res.rows.length, res.total);
				}).catch(() => {
					//联网失败, 结束加载
					this.mescroll.endErr();
				})
			},
		
		}
	}
</script>

<style lang="scss" scoped>
	
</style>